Skip to content

legacy reimport: make matching on title case-insensitive#12487

Merged
valentijnscholten merged 2 commits into
DefectDojo:bugfixfrom
valentijnscholten:reimport_legacy_titlecase_fix
May 22, 2025
Merged

legacy reimport: make matching on title case-insensitive#12487
valentijnscholten merged 2 commits into
DefectDojo:bugfixfrom
valentijnscholten:reimport_legacy_titlecase_fix

Conversation

@valentijnscholten

@valentijnscholten valentijnscholten commented May 20, 2025

Copy link
Copy Markdown
Member

In some scenario's the reimporter will fall back to the legacy dedupe algorithm that looks at the title and severity of existing findings. Although this is not a preferred situation, it happens when no dedupe hash field configuration is present for the parser.

At the time of writing this is the case for the OpenVAS parser. This can lead to false negative matching behavior as reported in #12378. This is because Defect Dojo uses titlecase to format the title of a finding before saving. So existing findings will can have a different title from the findings being processed by the reimporter because the latter are not saved yet. Since Postgres is performing case sensitive comparisons by default, we have to explicitly make the comparison case insensitive with this PR.

There are no tests cases covering this I believe. Adding a test case is doable, for example using an OpenVAS report. However we will probably add hash code config soon for OpenVAS rendering the test case useless. I think we should accept that we don't have explicit test cases for this "corner" or "legacy" scenario. I do think it's beneficial to merge this fix as it might be something first time users / PoC users run into for certain less used scan formats.

@valentijnscholten valentijnscholten marked this pull request as ready for review May 21, 2025 06:32
@valentijnscholten valentijnscholten added this to the 2.46.4 milestone May 21, 2025
@dryrunsecurity

Copy link
Copy Markdown

DryRun Security

This pull request identifies a potential vulnerability in Django ORM queries related to case-sensitive title matching, which could compromise finding deduplication and lead to unintended information disclosure in security tracking systems.

💭 Unconfirmed Findings (1)
Vulnerability Case-Sensitive Title Matching Vulnerability
Description A vulnerability in Django ORM queries where changing from strict exact matching to case-insensitive matching could potentially expose previously distinct findings, compromise finding deduplication, and lead to unintended information disclosure. The issue is located in dojo/importers/default_reimporter.py and dojo/utils.py, with potential risks to tracking and granularity of security findings.

All finding details can be found in the DryRun Security Dashboard.

@valentijnscholten valentijnscholten changed the title legacy reimport: match title case insensitive legacy reimport: make matching on title case-insensitive May 21, 2025
@Maffooch Maffooch requested review from dogboat and hblankenship May 21, 2025 17:31

@mtesauro mtesauro left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@valentijnscholten valentijnscholten merged commit 05dc721 into DefectDojo:bugfix May 22, 2025
77 checks passed
xansec pushed a commit to xansec/django-DefectDojo that referenced this pull request Jun 18, 2025
…12487)

* legacy reimport: match title case insensitive

* update reimporter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants